<div>
  <form class="form-horizontal" role="form" novalidate name="myForm">
    <div class="form-ctrl md-whiteframe-z1">
      <div class="form-search" style="height:270px;" ng-class="{true: 'shou'}[shoumun.num==0]" ng-switch on="sendData.timeType">
        <div>
          <label style="width:70px">业务线</label>
          <md-select ng-model="sendData.businessLine" >
          <md-select-label>
          {{sendData.businessLine ? _getNames(sendData.businessLine,'businessLineName') :'全部'}}
          </md-select-label>
          <md-option ng-value="">全部</md-option>
          <md-option ng-value="item" ng-repeat="item in businessLine">{{item.businessLineName}}</md-option>
          </md-select>
        </div>
        <div>
          <label style="width:70px">维度</label>
          <md-select multiple ng-model="sendData.queryType">
            <md-select-label>
            {{sendData.queryType.length ? _getNames(sendData.queryType,'queryTypeName',queryTypes) :'全部'}}
            </md-select-label>
            <md-option ng-value="" ng-click="_checkAll(sendData,'queryType');getBL()">全部</md-option>
            <md-option ng-value="queryType" ng-repeat="queryType in queryTypes">{{queryType.queryTypeName}}</md-option>
          </md-select>
        </div>
        <div>
            <label style="">账期</label>
            <md-select ng-model="sendData.timeType" placeholder="日">
              <md-option ng-value="item.timeTypeCode"  ng-repeat="item in timeTypes">{{item.timeTypeName}}</md-option>
            </md-select>
        </div>
        <div  ng-switch-when="5">
          <md-input-container flex>
            <label >开始时间</label>
            <input type="number" ng-model="sendData.startTime"  time-validate="year" end-time="sendData.endTime"required name="startYear">
            <div ng-messages="myForm.startYear.$error">
                <div ng-message="date">请正确输入时间</div>
                <div ng-message="time-error">开始时间不应大于结束时间</div>
                <div ng-message="too-great">结束时间不应大于当前时间</div>
            </div>
          </md-input-container>
        </div>
          <div  ng-switch-when="5" >
              <md-input-container flex>
              <label >结束时间</label>
              <input type="number" ng-model="sendData.endTime"  time-validate="year"  start-time="sendData.startTime" required name="endYear">
              <div ng-messages="myForm.endYear.$error">
                  <div ng-message="date">请正确输入时间</div>
                  <div ng-message="time-error">开始时间不应大于结束时间</div>
                  <div ng-message="too-great">结束时间不应大于当前时间</div>
              </div>
              </md-input-container>
          </div>
          <div  ng-switch-when="1">
              <md-input-container flex>
              <label >开始时间</label>
              <input type="date" ng-model="sendData.startTime"  time-validate="day"  end-time="sendData.endTime"  required name="startDate">
              <div ng-messages="myForm.startDate.$error">
                  <div ng-message="date">请正确输入时间</div>
                  <div ng-message="time-error">开始时间不应大于结束时间</div>
                  <div ng-message="too-great">结束时间不应大于当前时间</div>
              </div>
              </md-input-container>
          </div>
          <div  ng-switch-when="1" >
              <md-input-container flex >
              <label >结束时间</label>
              <input type="date" style="width:210px;" time-validate="day" ng-model="sendData.endTime"  start-time="sendData.startTime" required name="endDate">
              <div ng-messages="myForm.endDate.$error">
                  <div ng-message="date">请正确输入时间</div>
                  <div ng-message="time-error">开始时间不应大于结束时间</div>
                  <div ng-message="too-great">结束时间不应大于当前时间</div>
              </div>
              </md-input-container>
          </div>
          <div  ng-switch-when="3">
              <md-input-container flex>
              <label >开始时间</label>
              <input type="month" ng-model="sendData.startTime"  time-validate="month" end-time="sendData.endTime"  required name="startMonth">
              <div ng-messages="myForm.startMonth.$error">
                  <div ng-message="date">请正确输入时间</div>
                  <div ng-message="time-error">开始时间不应大于结束时间</div>
                  <div ng-message="too-great">结束时间不应大于当前时间</div>
              </div>
              </md-input-container>
          </div>
          <div  ng-switch-when="3">
              <md-input-container flex>
              <label >结束时间</label>
              <input type="month" ng-model="sendData.endTime"  time-validate="month" start-time="sendData.startTime" required name="endMonth">
              <div ng-messages="myForm.endMonth.$error">
                  <div ng-message="date">请正确输入时间</div>
                  <div ng-message="time-error">开始时间不应大于结束时间</div>
                  <div ng-message="too-great">结束时间不应大于当前时间</div>
              </div>
              </md-input-container>
          </div>
          <input-quarter-group ng-switch-when="4" start-time="sendData.startTime" end-time="sendData.endTime"></input-quarter-group>

          <div>
              <label style="width:70px">省公司</label>
              <md-select multiple ng-model="sendData.provinceCode" >
              <md-select-label>
              {{sendData.provinceCode.length ? _getNames(sendData.provinceCode,'provinceName',provinces) :'全部'}}
              </md-select-label>
              <md-option ng-value="" ng-click="_checkAll(sendData,'provinceCode')">全部</md-option>
              <md-option ng-value="item" ng-repeat="item in provinces">{{item.provinceName}}</md-option>
              </md-select>
          </div>
      </div>
      <i class="glyphicon glyphicon-chevron-up shrinkage" ng-show="!btnDisabled && showArrow" ng-click="shoumun.num=0"></i>
      <md-button ng-disabled="btnDisabled" ng-click="shoumun.num==1?shoumun.num=0:shoumun.num=1;search()" class="md-fab md-primary md-hue-1" aria-label="Profile"> <i class="glyphicon glyphicon-arrow-down" style="margin-top:28px;" ng-show="shoumun.num==0"></i> <i class="glyphicon glyphicon-search" ng-show="shoumun.num==1"></i>
      </md-button>
    </div>
  </form>
  <div class="table-info"  >
      <div class="menus" ng-show=" flag === 'table' || flag === 'view' ">
          <md-button aria-label="列表"  ng-click="changeTable()"  class="md-raised ico-btn">
          <img src="images/tables.png"></md-button>
          <md-button aria-label="图表" ng-click="changeView()" class="md-raised ico-btn">
          <img src="images/charts.png"></md-button>
          <form action="{{formPrefix}}"  target="_black" method="post" style="display: initial;">
              <input type="hidden" name="data" value="{{outData.data}}">
              <md-button  type="submit"  class="md-raised">导出Excel</md-button>
          </form>
      </div>
      <div ng-show="flag === 'view'">
          <div id="doc1" style="height:500px;"></div>
      </div>
      <div ng-show="flag === 'table'">
          <div class="table-detail" >
              <div class="t_r" style="overflow-x: scroll;">
                  <table class="table table-bordered" style="min-width: 100%;max-width: none;table-layout: fixed;word-break:break-all;">
                      <caption style="text-align:center;font-size:large;font-weight:bold;color:black">{{title}}</caption>
                      <thead>
                          <tr>
                              <th width="70px" rowspan="2">省代码</th>
                              <th width="80px;" rowspan="2"  ng-class="{dropup:showSeq}" class="cursor" ng-click="seqProvince(itemArray)">省公司<span class="caret"></span></th>
                              <th width="150px;" rowspan="2">总量</th>
                              <th width="290px;;" ng-repeat="businessLine in items">
                                  {{businessLine.queryTypeName}}
                              </th>
                          </tr>
                          <tr>
                              <th width="210px;" ng-repeat="businessLine in items" class="diffcount-td">
                                  <div style="width:38%;">成交量</div>
                                  <div style="width:35%;">失败量</div>
                                  <div style="width:27%;" ng-click="seqSuccessRate(itemArray,businessLine)" ng-class="{dropup:businessLine.successRateArrow}">成功率 <span class="caret"></span></div>
                              </th>
                          </tr>
                      </thead>
                      <tbody>
                          <tr ng-repeat="item in itemArray">
                              <td width="70px;">{{item.provinceCode}}</td>
                              <td width="80px;">{{item.provinceName}}</td>
                              <td width="90px;">{{item.total}}</td>
                              <td width="210px;" ng-repeat="lineData in item.lineData" class="diffcount-td">
                                  <div style="width:38%;">{{lineData.volume}}</div>
                                  <div style="width:35%;">{{lineData.failedAmount}}</div>
                                  <div style="width:27%;">{{lineData.processSuccessRate}}%</div>
                              </td>
                          </tr>
                          <tr class="summary">
                              <td width="70px">汇总</td>
                              <td width="80px"></td>
                              <td width="90px">{{total}}</td>
                              <td width="210px" ng-repeat="lineData in gather.data" class="diffcount-td">
                                  <div style="width:38%">{{lineData.sumVolume}}</div>
                                  <div style="width:35%">{{lineData.sumFailedAmount}}</div>
                                  <div style="width:27%">{{lineData.successRate.toFixed(4)}}%</div>
                              </td>
                          </tr>
                      </tbody>
                  </table>
              </div>
          </div>
      </div>
  </div>
</div>